fix(devkit): add required registry url and schema location to local-simple-bap - #484
fix(devkit): add required registry url and schema location to local-simple-bap#484skdas20 wants to merge 1 commit into
Conversation
…imple-bap The dediregistry and schemav2validator plugins both read required values from config that this template did not set, so a node started from it fails during validateSign/validateSchema instead of coming up. schemav2validator/cmd/plugin.go returns 'location not configured' when the key is absent, and dediregistry/cmd/plugin.go reads config["url"] with no fallback. Values match the working local-p2p-bap.yaml in the same repo, including its pinned schema tag rather than a moving main ref. Applied to both the bapTxnReceiver and bapTxnCaller modules. Fixes beckn#418 Signed-off-by: skdas20 <skdas5405@gmail.com>
|
Correction to my own PR description — I overstated the mechanism and want to fix that on the record before anyone reviews it. I wrote that // Primary spec is optional — a non-Beckn deployment may rely solely on auxiliary specs.
if typeVal != "" && locVal == "" {
return nil, nil, errors.New("location not configured")
}It only errors when So the diff still matches the working Treat this as "align the template with the working one" rather than "fix a hard startup error", and please weigh it accordingly — I'd rather flag that myself than have it found in review. |
Fixes #418.
Why the node fails
Both plugins read values from config that this template does not set:
schemav2validator/cmd/plugin.goreturnserrors.New("location not configured")whenlocationis absent — the validator never initialises.dediregistry/cmd/plugin.goreadsconfig["url"]with no fallback.So a node started from
local-simple-bap.yamlfails at thevalidateSign/validateSchemasteps rather than coming up, which matches the reported symptom.Values
Rather than take the URLs from the issue verbatim, I matched
devkits/p2p-trading-ies-wave1/config/local-p2p-bap.yaml, a working config in this repo that sets all three:registry.urlhttps://fabric.nfh.global/registry/dedischemaValidator.typeurlschemaValidator.location…/protocol-specifications-v2/tags/core-2.0.0-rc-eos-release/api/beckn.yamlOne deliberate difference from the issue: it proposed the schema at
…/main/api/v2.0.0/beckn.yaml. Both that and the pinned tag return 200, but I used the pinned tag because that is what the working config uses and amainref would drift when upstream moves. Happy to switch if you'd rather trackmain.I also left
allowedNetworkIDsuntouched — the issue proposed addingwinroom-ies-data-exchange, but the file has since changed and already carriestest-ies-data-sharing-network, so that part appears to have been addressed separately.Applied to both the
bapTxnReceiverandbapTxnCallermodules. YAML validated.One thing worth flagging
No other devkit config sets these keys either — I checked all of them, and
registry.url,schemaValidator.typeandschemaValidator.locationare absent everywhere exceptlocal-p2p-bap.yaml. So the other templates likely fail the same way. I kept this PR to the file named in the issue rather than changing configs I haven't been able to run, but it's probably worth a follow-up if you confirm the others are meant to be runnable as-is.